package main.Ontology;

import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;
import main.KBProcess.Element;

/**
 * @author Jared Hance
 *
 * Includes DocumentLanguageOntology, DocumentCategoryOntology, and EntityTypeOntology. Can be directly
 * extended to add more.
 */
public class DefaultElementOntologyFactory implements ElementOntologyFactory, Serializable, Cloneable {
	private final Map<Object, ElementOntology> cache;
	
	public DefaultElementOntologyFactory() {
		this.cache = new HashMap<Object, ElementOntology>();
	}
	
	@Override
	public ElementOntologySet createElementOntologies(Element element) {
		ElementOntologySet ontologies = this.createEmptyOntologySet();
		ontologies.add(new DocumentLanguageOntology(element));
		ontologies.add(new DocumentCategoryOntology(element));
		ontologies.add(new EntityTypeOntology(element));
		
		return ontologies;
	}

	@Override
    public ElementOntologySet createEmptyOntologySet() {
        return new ElementOntologySet(cache);
    }
}
